/**
* @file segmentDifferences.h
* @author Alberto Basso, Luca Tumelero
* @brief Automatic difference check method
*/

#ifndef SEGMENTDIFFERENCES_H
#define SEGMENTDIFFERENCES_H

#include <pcl/segmentation/segment_differences.h>
#include <pcl/segmentation/extract_clusters.h>

using namespace std;
using namespace pcl;

/**
 * @brief Find all the euclidean cluster in a point cloud.
 *
 * @param cloud Pointer to the input cloud.
 * @param tolerance Euclidean clustering threshold
 * @param min The minimum number of points in a cluster
 * @param max The maximum number of points in a cluster
 * @return vector<PointIndices> The vector of PointIndices of the clusters found.
 */
vector<PointIndices> findClusters(PointCloud<PointXYZRGB>::Ptr cloud, double tolerance, int min, int max);
/**
 * @brief Return a cloud of point that are different from source cloud to target cloud
 *
 * @param[in] registeredCloud Source cloud registered
 * @param[in] targetCloud Target cloud
 * @param[out] diffCloud Difference cloud
 * @param[in] scoreThreshold Threshold for the score to be considered a difference
 * @param[in] distanceThreshold Distance threshold to be considered different
 * @return int Success of the method
 */
int findWrongClusters(PointCloud<PointXYZRGB>::Ptr registeredCloud,PointCloud<PointXYZRGB>::Ptr targetCloud,
                         PointCloud<PointXYZRGB>::Ptr diffCloud, float scoreThreshold, float distanceThreshold);

#endif // SEGMENTDIFFERENCES_H
